<template>
	<view class="flex-col page">
		<view>
			<view :style="{height:statusBarHeight+'px'}"></view>
			<u-navbar :title="title" bgColor="#F5F5F5" @leftClick="$nav(2)">	
			</u-navbar>
		</view>
		
		<view style="margin: 28rpx;">
			<mp-html :content="content"></mp-html>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				id:1,
				content:''
			};
		},
		onLoad(op) {
			this.id = op.id
			if(this.id == 1){
				this.title = '用户服务协议'
			}else if(this.id == 2){
				this.title = '隐私政策'
			}else{
				this.title = '充值协议'
			}
			this.getAgreement();
		},
		computed:{
			statusBarHeight(){
				return this.$store.state.statusBarHeight + 44
			}
		},
		methods:{
			getAgreement(){
				this.$request({
					url:'?c=Index&a=agreement',
					type:'post',
					data:{
						content_id:this.id
					}
				}).then(res =>{
					this.content = res.data;
				})
			}
		}
	}
</script>

<style lang="scss">
.page {
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100vh;
}
</style>
